package language;

import java.io.Serializable;
import language.AttributeType.tokenType;

/**
 * Classe estesa da Token e Non Terminale.
 * @author Giovanni Cammarata
 */
public class Element implements Serializable{

    private String name;
    private AttributeType.tokenType thisTokenType;
    private String typeAttribute;

    public Element(){
        
    }
    public Element(String name) {
        this.name = name;
        this.thisTokenType = AttributeType.tokenType.niente;
        this.typeAttribute = null;
    }

    public Element(String name, tokenType thisTokenType, String typeAttribute) {
        this(name);
        this.thisTokenType = thisTokenType;
        this.typeAttribute = typeAttribute;
    }

    public String getName() {
        return name;
    }

    public tokenType getThisTokenType() {
        return thisTokenType;
    }

    public String getTypeAttribute() {
        return typeAttribute;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setThisTokenType(tokenType thisTokenType) {
        this.thisTokenType = thisTokenType;
    }

    public void setTypeAttribute(String typeAttribute) {
        this.typeAttribute = typeAttribute;
    }

    @Override
    public String toString() {
        return name;
        //return "Element{" + "name=" + name + ", thisTokenType=" + thisTokenType + ", typeAttribute=" + typeAttribute + '}';
    }
}
